<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.systop.ltbook.webapp.LtConstants, java.util.Map, java.util.List, com.systop.ltbook.book.model.Book" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>中国校校通</title>
  <%@include file="/pages/new/resources.jsp" %>
</head>
<body>
<table width="1002" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td background="${ctx}/images/lt_new/class_t_bg.gif">
      <table width="1002" height="40" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="111" align="center" style="color: #000;">
            <b>龙天图书</b>
          </td>
          <td width="890" align="right" style="padding-right:40px; font-weight: bold;">
            &nbsp;&nbsp;<a href="indexBooks.do?bookType=1" style="color: green;" title="新书">新书</a>&nbsp;&nbsp;
            &nbsp;&nbsp;<a href="indexBooks.do?bookType=2" style="color: green;" title="热销">热销</a>&nbsp;&nbsp;
            &nbsp;&nbsp;<a href="indexBooks.do?bookType=3" style="color: green;" title="特价">特价</a>&nbsp;&nbsp;
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="1002" height="470" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="782" height="460" valign="top">
      <table width="774" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="774"  height="310" colspan="3">
            <div style="width:770px;">
            <%
            	Map<String, Object> data = (Map<String, Object>)request.getAttribute("data");
				List<Book> imgBooks = (List)data.get(LtConstants.IMGBOOKS);
            %>
            <% for(Book book : imgBooks){ %>
              <div class="books">
		        <div class="bkphoto">
		          <a href="${ctx}/book/view.do?model.id=<%=book.getId()%>" target="_blank" title="<%=book.getName()%>">
		            <img height="100" width="90" src="${ctx}<%=book.getCoverPhoto()%>" onError="this.src='${ctx}/images/longtian/book_nophoto_big.gif'"></a>
		        </div>
		        <div class="bookinfo">
		          <a href="${ctx}/book/view.do?model.id=<%=book.getId()%>" target="_blank" title="<%=book.getName()%>"><%=book.getName()%></a>
		        </div>
		      </div>
            <% } %>
            </div>
          </td>
        </tr>
        <tr>
          <td width="224" height="150" align="center">
            <img src="${ctx}/images/gg/book-left.jpg" width="190" >
          </td>
          <%
          	List<Book> books = (List)data.get(LtConstants.BOOKS);
	        int size = books.size();
	      	int fstEnd = 0;
	      	int senEnd = 0;
	      	if (size > 6){
	      		fstEnd = 6;
	      		senEnd = size;
	      	}else{
	      		fstEnd = size;
	      		senEnd = 0;
	      	}
          %>
          <td width="275" style="padding-left: 5px;">
	          <% for(int i = 0; i < fstEnd; i++){ %>
		        <div class="bookTitle" title="<%=books.get(i).getName()%>">
		        <a href="${ctx}/book/view.do?model.id=<%=books.get(i).getId()%>" target="_blank"><%=books.get(i).getName()%></a></div>
	          <% } %>
          </td>
          <td width="275" style="padding-left: 5px;">
             <% 
	        	if (senEnd != 0){
	        	for(int i = 6; i < senEnd; i++){ 
	         %>
		       <div class="bookTitle" title="<%=books.get(i).getName()%>">
		       <a href="${ctx}/book/view.do?model.id=<%=books.get(i).getId()%>"  target="_blank"><%=books.get(i).getName()%></a></div>
	         <% }} %>
          </td>
        </tr>
      </table>
    </td>
    <td width="220" height="310" valign="top">
	  <table width="218" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="36"  align="center" background="${ctx}/images/lt_new/right_bg.gif" class="greenfont">
            &nbsp;本周畅销榜&nbsp;
          </td>
        </tr>
        <tr>
          <td height="284" valign="top" background="${ctx}/images/lt_new/right_2.gif">
            <table width="190" height="284" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="270" valign="top">
                  <s:if test="#attr.data.top10books != null">
                  	<% int topnum = 1; %>
                  	<s:iterator value="#attr.data.top10books" var="b">
                      <div class="orderdiv">
                  		<div style="float: left; width: 14px; text-align: right; font-weight: bold;"><%=topnum++ %></div>
                  	 	<div style="float:right;" class="shotBookTitle" title="${b.name}">
			            <a href="${ctx}/book/view.do?model.id=${b.id}" target="_blank">${b.name}</a></div>
			          </div>
                  	</s:iterator>
                  </s:if>
                </td>
              </tr>
            </table>
            <div style="text-align: right; padding:5px 15px 0px 0px;">更多...</div>
            <table width="218" height="14" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                 <td width="218" height="14" background="${ctx}/images/lt_new/right_3.gif"></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <table width="208" height="104" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center">
            <img src="${ctx}/images/gg/book-right.jpg" width="208" height="104" />
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>